<script language='javascript' type='text/javascript' src="<?=base_url('blocks')?>scripts/PopupWindow.js"></script>
<script language='javascript' type='text/javascript'>
var obj_popup = null;
var testpopup = null;
function popup(kind, prefix) {
	testpopup = new PopupWindow(kind);
	testpopup.offsetY = 25;
	testpopup.autoHide();
	testpopup.showPopup(prefix);
	obj_popup = kind;
}

function set_login(para){
	if(obj_popup){
		testpopup.hidePopup();
		login(para);
	}
}

function set_register(para){
	if(obj_popup){
		testpopup.hidePopup();
		register(para);
	}
}

</script>

<? if($logged == 0) {?>
	<div style="color:#FF0000; font-weight:bold">
	<form name='frmLogin' action="#" method="post">
	Email: <input type="text" name="email" style="border:1px solid;" />
	Mật khẩu: <input type="password" name="pass" style="border:1px solid;" />
	<input id='btlogin' type="button" name="btlogin" value="Đăng Nhập" onclick="popup('testdiv1',this.id);return false;" />
	<input id='btregister' type="button" name="btregister" value="Đăng Ký" onclick="popup('testdiv2',this.id);return false;" />
	<!--
	<input type="button" name="btlogin2" value="Đăng Nhập" onclick="login(1)" />	
	<input type="button" name="btregister2" value="Đăng Ký" onclick="register(1)" />
	<a href="<?=site_url('Hoc-Vien/Dang-Nhap')?>">[Học Viên] </a>
	<a href="<?=site_url('Nha-Cung-Cap/Dang-Nhap')?>">[Nhà Cung Cấp] </a>
	-->
	</form>
    </div>
	
<? } else {?>
	<div style="color:#FF0000; font-weight:bold">
		Hi, <?=$login_email?><a href="<?=site_url('login/logout')?>">[Logout] </a>&nbsp;
		<a href="<?=site_url('Hoc-Vien/Quan-Ly')?>">[My Page] </a>
	</div>
<? } ?>
<DIV id=testdiv1 style="VISIBILITY: hidden; POSITION: absolute; BACKGROUND-COLOR: #cccccc; border:1px solid; ">
<table border="0" style="border-collapse:collapse">	
	<tr><td style="font-weight:bold;background:#0000FF; color:#FFFFFF; cursor:pointer; width:75px;" onClick="set_login(0)" title="Chọn Học Viên">Học Viên</td></tr>
	<tr><td nowrap="nowrap" style="font-weight:bold; background:#00FF00; color:#FFFFFF; cursor:pointer; width:75px;" onClick="set_login(1)" title="Chọn Nhà Cung Cấp">Nhà Cung Cấp</td></tr>
	
</table>
</DIV>
<DIV id=testdiv2 style="VISIBILITY: hidden; POSITION: absolute; BACKGROUND-COLOR: #cccccc; border:1px solid; ">
<table border="0" style="border-collapse:collapse">	
	<tr><td style="font-weight:bold;background:#0000FF; color:#FFFFFF; cursor:pointer; width:75px;" onClick="set_register(0)" title="Chọn Học Viên">Học Viên</td></tr>
	<tr><td nowrap="nowrap" style="font-weight:bold; background:#00FF00; color:#FFFFFF; cursor:pointer; width:75px;" onClick="set_register(1)" title="Chọn Nhà Cung Cấp">Nhà Cung Cấp</td></tr>
	
</table>
</DIV>